<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<base href="${basePath}">
<link rel="stylesheet" type="text/css" href="static/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css"
	href="static/css/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css"
	href="static/css/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="static/css/skin.css"
	id="skin" />
<link rel="stylesheet" type="text/css" href="static/css/style.css" />
<link href="semantic/semantic.css" rel="stylesheet" type="text/css">
<link href="static/css/teacher.css" rel="stylesheet" type="text/css">
<!-- jquery一定要在semantic之前导入 -->
<script src="static/js/jquery-1.12.4.js" type="text/javascript"></script>
<script src="semantic/semantic.js" type="text/javascript"></script>
<script src="static/js/student.js" type="text/javascript"></script>
 <link href="static/css/bootstrap.min.css" rel="stylesheet">
    <link href="static/css/dashboard.css" rel="stylesheet">
<title>学员管理</title>
</head>
<body>
	<jsp:include page="../dingheader.jsp" />
	<jsp:include page="../zuoheader.jsp" />

	<div class="page-container">
		<form action="student?method=selectby" method="post">
			<div class="text-c">
				<input type="text" name="names" id="" placeholder="姓名"
					value="${param.names }" style="width: 120px" class="input-text"
					value="${param.names }"> 是否分配 <select name="allot"
					style="width: 120px; height: 28px;">
					<option selected="selected" value=""
						${param.allot !=0&&param.allot !=1?'selected':''}>请选择</option>
					<option value="1">是</option>
					<option value="0">否</option>
				</select> 兴趣筛选 <select name="interestings"
					style="width: 120px; height: 28px;">
					<option selected="selected" value="">请选择</option>
					<c:forEach items="${inlist }" var="in">
						<option value="${in.interestingId}"
							${param.interestings == in.interestingId?'selected':''}>${in.interestingName}</option>
					</c:forEach>
				</select> 来源 <select name="sources" style="width: 120px; height: 28px;">
					<option selected="selected" value="">请选择</option>
					<c:forEach items="${solist }" var="so">
						<option value="${so.sourceId}"
							${param.sources == so.sourceId?'selected':''}>${so.sourceName}</option>
					</c:forEach>
				</select> 咨询师 <select name="staffname" style="width: 120px; height: 28px;">
					<option selected="selected" value="">请选择</option>
					<c:forEach items="${StaffList}" var="staffPo">
						<option value="${staffPo.staffId}"
							${param.staffname ==staffPo.staffId?'selected':''}>${staffPo.staffName }
					</c:forEach>
				</select>
				<button name="" id="" class="btn btn-success" type="submit">
					<i class="Hui-iconfont">&#xe665;</i> 查询
				</button>
			</div>
		</form>
		<div>${errors}</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l"> <a class="btn btn-danger radius" id="allot1">
					<i class="Hui-iconfont">&#xe6e2;</i> 批量分配
			</a> <a class="btn btn-primary radius"
				onclick="picture_add('添加图片','picture-add.html')" href="javascript:;"
				id="add"><i class="Hui-iconfont">&#xe600;</i> 添加学员</a>
			</span> <span class="r">共有数据：<strong>${allcount }</strong> 条
			</span>
		</div>

		<div class="mt-20">
			<div style="color: red;">注：您可点击学员姓名查看学员更多信息</div>
			<table
				class="table table-border table-bordered table-bg table-hover table-sort">
				<thead>
					<tr class="text-c">
						<th width="40"><input name="" type="checkbox" value=""
							id="checkAll"></th>
						<th width="70">姓名</th>
						<!-- <th width="50">性别</th> -->
						<!-- 			<th width="60">学历</th>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> <a href="staff?method=forward">首页
		</a><span class="c-gray en">&gt;</span> <a href="student?method=selectby">学员管理
		</a><span class="c-gray en">&gt;</span>
	</nav>
	<div class="page-container">
		<form action="student?method=selectby" method="post">
			<div class="text-c">
				<input type="text" name="names" id="" placeholder="姓名"
					value="${param.names }" style="width: 120px" class="input-text"
					value="${param.names }"> 是否分配 <select name="allot"
					style="width: 120px; height: 28px;">
					<option selected="selected" value=""
						${param.allot !=0&&param.allot !=1?'selected':''}>请选择</option>
					<option value="1">是</option>
					<option value="0">否</option>
				</select> 兴趣筛选 <select name="interestings"
					style="width: 120px; height: 28px;">
					<option selected="selected" value="">请选择</option>
					<c:forEach items="${inlist }" var="in">
						<option value="${in.interestingId}"
							${param.interestings == in.interestingId?'selected':''}>${in.interestingName}</option>
					</c:forEach>
				</select> 来源 <select name="sources" style="width: 120px; height: 28px;">
					<option selected="selected" value="">请选择</option>
					<c:forEach items="${solist }" var="so">
						<option value="${so.sourceId}"
							${param.sources == so.sourceId?'selected':''}>${so.sourceName}</option>
					</c:forEach>
				</select> 咨询师 <select name="staffname" style="width: 120px; height: 28px;">
					<option selected="selected" value="">请选择</option>
					<c:forEach items="${StaffList}" var="staffPo">
						<option value="${staffPo.staffId}"
							${param.staffname ==staffPo.staffId?'selected':''}>${staffPo.staffName }
					</c:forEach>
				</select>
				<button name="" id="" class="btn btn-success" type="submit">
					<i class="Hui-iconfont">&#xe665;</i> 查询
				</button>
			</div>
		</form>
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l"> <a class="btn btn-danger radius" id="allot1">
					<i class="Hui-iconfont">&#xe6e2;</i> 批量分配
			</a> <a class="btn btn-primary radius"
				onclick="picture_add('添加图片','picture-add.html')" href="javascript:;"
				id="add"><i class="Hui-iconfont">&#xe600;</i> 添加学员</a>
			</span> <span class="r">共有数据：<strong>${allcount }</strong> 条
			</span>
		</div>

		<div class="mt-20">
			<div style="color: red;">注：您可点击学员姓名查看学员更多信息</div>
			<table
				class="table table-border table-bordered table-bg table-hover table-sort">
				<thead>
					<tr class="text-c">
						<th width="40"><input name="" type="checkbox" value=""
							id="checkAll"></th>
						<th width="70">姓名</th>
						<!-- <th width="50">性别</th> -->
						<!-- 			<th width="60">学历</th>
					<th width="80">地址</th> -->
						<th width="80">电话</th>
						<!-- 	<th width="80">QQ</th> -->
						<!-- 	<th width="60">父母姓名</th>
					<th width="80">父母电话</th>
					<th width="180">填表时间</th>-->
						<th width="180">学生来源</th>
						<th width="180">IT热爱程度</th>
						<th width="160">是否分配</th>
						<th width="160">分配咨询师</th>
						<th width="160">是否缴费</th>
						<th width="160">分班情况</th>
						<th width="130">操作</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${empty list }">
						<tr class="text-c">
							<th colspan="11">无记录</th>
						</tr>
					</c:if>
					<c:forEach items="${list }" var="l">
						<tr class="text-c">
							<th><c:if test="${l.studentAllotId==0&&empty l.clazzname}">
									<input class="item-check" name="" type="checkbox"
										value="${l.studentId}">
								</c:if></th>
							<th width="70"><a
								href="allot/one?stuid=${l.studentId}&clazzname=${l.clazzname}&total_student_id=${l.total_student_id}&staffname=${l.staffName}">${l.studentName }</a></th>
							<%-- 	<c:if test="${l.studentSex==1 }">
					<th width="50">男</th>
					</c:if>
					<c:if test="${l.studentSex==0 }">
					<th width="50">女</th>
					</c:if> --%>
							<%-- <th width="60">${l.studentRecode }</th>
					<th width="80">${l.studentAddress}</th> --%>
							<th width="80">${l.studentPhone}</th>
							<%-- 	<th width="80">${l.studentQq}</th> --%>
							<%-- 	<th width="80">${l.studentParent}</th>
					<th width="80">${l.studentParentPhone}</th>
					<th width="180">${l.studentComedate}</th>--%>
							<th width="180">${l.sourceName}</th>
							<th width="180">${l.interestingName}</th>
							<c:if test="${l.studentAllotId==0}">
								<th width="160">否</th>
							</c:if>
							<c:if test="${l.studentAllotId!=0}">
								<th width="180">是</th>
							</c:if>
							<c:if test="${empty l.staffName}">
								<th width="160">未分配</th>
							</c:if>
							<c:if test="${not empty l.staffName}">
								<th width="160">${l.staffName}</th>
							</c:if>
							<c:if test="${empty l.total_student_id}">
								<th width="160">否</th>
							</c:if>
							<c:if test="${not empty l.total_student_id}">
								<th width="160">是</th>
							</c:if>
							<c:if test="${empty l.clazzname}">
								<th width="160">未分班</th>
							</c:if>
							<c:if test="${not empty l.clazzname}">
								<th width="160">${l.clazzname}</th>
							</c:if>
							<th width="130">
								<%-- <a href="staff?method=delete&id=${l.studentId}" >
					<span class="label label-success radius">删除</span></a> --%> <a
								href="student?method=update&id=${l.studentId}"> <span
									class="label label-success radius">修改</span></a>
									 <c:if test="${l.studentAllotId==0&&empty l.clazzname}">
									<a onclick="anginallot(${l.studentId})"> <span
										class="label label-success radius">分配</span>
									</a>
								</c:if> <input type="hidden" id="iid" value="${l.studentId }">
								<c:if test="${empty l.clazzname&&not empty l.total_student_id}">
									<a onclick="fenban(${l.studentId })"> <span
										class="label label-success radius">分班</span></a>
								</c:if>
						</th>
					</c:forEach>
				</tbody>
			</table>
			<c:if test="${totalPage > 1 }">
				<div class="page">
					<a
						<c:if test="${page!=1}">href="student?method=selectby&page=1${queryString}"</c:if>
						class="${page == 1?'disable':''}">首页</a> <a
						<c:if test="${page!=1}">href="student?method=selectby&page=${page-1}${queryString}"</c:if>
						class="${page == 1?'disable':''}">上一页</a>
					<c:forEach begin="1" end="${totalPage }" var="t">
						<a href="student?method=selectby&page=${t}${queryString}">${t }</a>
					</c:forEach>
					<a
						<c:if test="${page!=totalPage}">href="student?method=selectby&page=${page+1}${queryString}"</c:if>
						class="${page == totalPage?'disable':''}">下一页</a> <span> <a
						<c:if test="${page!=totalPage}">href="student?method=selectby&page=${totalPage }${queryString}"</c:if>
						class="${page == totalPage?'disable':''}">最后一页</a> <span>
							${page}/${ totalPage} </span>
				</div>
			</c:if>
		</div>
	</div>
	<script src="static/js/jquery-1.12.4.js" type="text/javascript"></script>
	<script type="text/javascript" src="static/js/jquery.min.js"></script>
	<script type="text/javascript" src="static/js/layer.js"></script>
	<script type="text/javascript" src="static/js/WdatePicker.js"></script>
	<script type="text/javascript" src="statoc/js/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="static/js/H-ui.js"></script>
	<script type="text/javascript" src="static/js/H-ui.admin.js"></script>
	<script src="static/js/jquery-1.12.4.js" type="text/javascript"></script>
	<script src="static/js/student.js" type="text/javascript"></script>

	<div id="deptadd">
		<iframe class="thickframe" id="thickframe" marginwidth="0"
			marginheight="0" frameborder="1" scrolling="no"
			style="width: 100%; height: 1162px;"> </iframe>
		<div class="thickdiv" id="thickdiv"
			style="width: 100%; height: 1162px;"></div>
		<div class="thickbox" id="thickbox"
			style="left: 450.5px; top: 80px; width: 402px; height: 512px;">
			<div class="thickwrap" style="width: 760px;">
				<div class="thicktitle" id="" style="width: 740">
					<span>添加学员</span>
				</div>
				<div class="thickcon" id=""
					style="width: 400px; height: 500px; padding-left: 20px; padding-right: 20px;">
					<div id="addressDiagDiv">
						<div class="m" id="edit-cont">
							<div>
								<!-- 	<span id="xxx">x</span> -->
							</div>
							<form action="student?method=insert" method="post" class="form">
								<table>
								<tr>
									<td></td>
									<td><div id="hint"></div></td>
								</tr>
									<tr>
										<td>姓名</td>
										<td><input id="name" style="width: 200px; height: 30px;"
											name="name" type="text" class="text" 
											></td>
									</tr>
									
									<tr>
										<td>性别</td>
										<td><input type="radio" value="1" name="sex"
											checked="checked">男<input type="radio" value="0"
											name="sex" value="0">女</td>
									</tr>
									<tr>
										<td>QQ</td>
										<td><input style="width: 200px; height: 30px;" id="qq"
											name="qq" type="text" class="text" maxlength="10" onkeyup="value=value.replace(/[^(\d)]/g,'')"></td>
									</tr>
									<tr>
										<td>地址</td>
										<td><input style="width: 200px; height: 30px;"
											id="address" name="address" type="text" class="text"></td>
									</tr>
									<tr>
										<td>学历</td>
										<td><input style="width: 200px; height: 30px;"
											id="recode" name="recode" type="text" class="text"></td>
									</tr>
									<tr>
										<td>电话</td>
										<td><input style="width: 200px; height: 30px;" id="phone"
											name="phone" type="text" class="text" maxlength="11" onkeyup="value=value.replace(/[^(\d)]/g,'')"></td>
									</tr>

									<tr>
										<td>父母姓名</td>
										<td><input style="width: 200px; height: 30px;"
											id="parentname" name="parentname" type="text" class="text"></td>
									</tr>
									<tr>
										<td>父母电话</td>
										<td><input style="width: 200px; height: 30px;"
											id="parentphone" name="parentphone" type="text" class="text" maxlength="11" onkeyup="value=value.replace(/[^(\d)]/g,'')"></td>
									</tr>
									<tr>
										<td>来源</td>
										<td><select name="source"
											style="width: 200px; height: 30px;">
												<c:forEach items="${solist }" var="so">
													<option value="${so.sourceId}"
														${param.source==so.sourceId?'selected':'' }>${so.sourceName }</option>
												</c:forEach>
										</select></td>
									</tr>
									<tr>
										<td>兴趣程度</td>
										<td><select name="interesting"
											style="width: 200px; height: 30px;">
												<c:forEach items="${inlist }" var="in">
													<option value="${in.interestingId}"
														${param.iteresting == in.interestingId?'selected':''}>${in.interestingName}</option>
												</c:forEach>
										</select></td>
									</tr>
									<tr>
										<td id="zeng"><button id="button" class="ui button" style="text-align:center;height:36px">
												保存
											</button></td>
										<td id="qu">
											<div class="ui button">取消</div>
										</td>
									</tr>

								</table>
							</form>

						</div>
					</div>
				</div>
			</div>
		</div>
	</div>


	<div id="fenban">
		<iframe class="thickframe" id="thickframe" marginwidth="0"
			marginheight="0" frameborder="1" scrolling="no"
			style="width: 100%; height: 1162px;"> </iframe>
		<div class="thickdiv" id="thickdiv"
			style="width: 100%; height: 1162px;"></div>
		<div class="thickbox" id="thickbox"
			style="left: 500.5px; top: 180px; width: 402px; height: 202px;">
			<div class="thickwrap" style="width: 760px;">
				<div class="thicktitle" id="" style="width: 740">
					<span>分班</span>
				</div>
				<div class="thickcon" id=""
					style="width: 400px; height: 200px; padding-left: 20px; padding-right: 20px;">
					<div id="addressDiagDiv">
						<div class="m" id="edit-cont">
							<div>
								<!-- 	<span id="xxx">x</span> -->
							</div>
							<form action="group?method=insert" onsubmit="return check()"
								method="post">
								<input type="hidden" value="" id="fenid" name="studentId">
								<div id="claz">
									<label style="width: 200px; height: 30px;">班级</label> <select
										name="clazz" style="width: 200px; height: 30px;">
										<c:forEach items="${clazzlist }" var="cla">
											<option value="${cla.clazzId}"
												${param.clazz==cla.clazzId?'selected':'' }>${cla.clazzName }</option>
										</c:forEach>
									</select>
								</div>
								<div class="ui button"  id="save">保存</div>
								<div class="ui button" id="close">取消</div>

							</form>

						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div id="fenpei">
		<iframe class="thickframe" id="thickframe" marginwidth="0"
			marginheight="0" frameborder="1" scrolling="no"
			style="width: 100%; height: 1162px;"> </iframe>
		<div class="thickdiv" id="thickdiv"
			style="width: 100%; height: 1162px;"></div>
		<div class="thickbox" id="thickbox"
			style="left: 500.5px; top: 180px; width: 402px; height: 202px;">
			<div class="thickwrap" style="width: 760px;">
				<div class="thicktitle" id="" style="width: 740">
					<span>分配</span>
				</div>
				<div class="thickcon" id=""
					style="width: 400px; height: 200px; padding-left: 20px; padding-right: 20px;">
					<div id="addressDiagDiv">
						<div class="m" id="edit-cont">
							<div>
								<!-- 	<span id="xxx">x</span> -->
							</div>
							<form action="student/allot" onsubmit="return check()"
								method="post">
								<input type="hidden" class="studentid" name="ids" id="fenpeiid">
								<div id="claz">
									<label style="width: 200px; height: 30px;">班级</label> <select
										name="staffid">
										<c:forEach items="${StaffList}" var="staffPo">
											<option value="${staffPo.staffId}">${staffPo.staffName }
										</c:forEach>
									</select>
								</div>
								<div class="ui positive  button" id="save">
									<button>保存</button>
								</div>
								<div class="ui button" id="closes">取消</div>

							</form>

						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

</body>
</html>